Skip to content

Conversation

@Sovietaced
Copy link

@Sovietaced Sovietaced commented Mar 25, 2025

Description

This pull request is a reworked version of #1583

I started from scratch and ported over @CoLa5's changes so that I could understand what the code was doing. I had to make things work with the more recently added request/response hooks.


Currently, the OpenTelemetryClientInterceptor is based on an external implementation of grpc client interceptors whose source code lies in the package grpcext.

To support the official grpc.UnaryUnaryClientInterceptor-, grpc.UnaryStreamClientInterceptor-, grpc.StreamUnaryClientInterceptor-, and grpc.StreamStreamClientInterceptor-interface, which are supported officially in grpc since v1.8.0, the source code of the _client.py-module is adapted.

Hereby, the design of the _client.py-module orientates itself strongly on the design of the _aio_client.py-module. Thus, the external implementation of the grpc client interceptors can be removed (package grpcext). Also, the RpcInfo-class in the utilities.py-module is not required any more.

The _aio_client.py-module must be adapted so that the _BaseAioClientInterceptor becomes independent of the _BaseClientInterceptor.

The test_client_interceptor_trace_context_propagation-tests are adapted according to the same test in the test_aio_client_interceptor.py-module to remove the dependency on the external implementation of the grpc client interceptors, which are located in the package grpcext.

The documentation of the code in the init.py is adapted accordingly.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tested

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@robert-lore
Copy link

I feel like this is a bigger issue that is known, especially because the means of resolve is so hard to find. The issue is here. Is there any way this can get some attention so that it is merged in a timely manner?

@juandelacruz-calvo
Copy link

Hello @Sovietaced Thanks for the PR. We are struggling with the instrumentation of PubSub clients on GCP due to this issue, do you know how to get some momentum on this PR?

@juandelacruz-calvo
Copy link

Tagging @aabmass as for Google, since this is affecting GCP PubSub

@Sovietaced
Copy link
Author

Hello @Sovietaced Thanks for the PR. We are struggling with the instrumentation of PubSub clients on GCP due to this issue, do you know how to get some momentum on this PR?

I do not know how to get momentum on this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

4 participants